<?php 
require "Controller.php";
require "Home/Model/indexModel.php";
class IndexController extends Controller{
	
	function __construct(){
		parent::__construct();
		$this->mod=new goodsModel;
	}
	public function index(){ 
	
		$data1=$this->mod->getgoods1();
		$data2=$this->mod->getgoods2();
		$data3=$this->mod->getgoods3();
		$data4=$this->mod->getgoods4();
		$data5=$this->mod->getgoods5();
		// $data6=$this->mod->getTopHit();
		// $data7=$this->mod->getTopDown();
		
		$this->assign('goods1',$data1);
		$this->assign('goods2',$data2);
		$this->assign('goods3',$data3);
		$this->assign('goods4',$data4);
		$this->assign('goods5',$data5);
		// $this->assign('Tophit',$data6);
		// $this->assign('Topdown',$data7);
		$this->display(); 
		
	}

	public function lists(){
        $data8 = $this->mod->getgoodstype();
        $data9 = $this->mod->getgoodstypename();
        $data3=$this->mod->getgoods3();
        $this->assign('goods3',$data3);
        // $data12=$this->mod->getTopDown2();
        // $this->assign('Topdown2',$data12);

        $this->assign('goods6',$data8);
        $this->assign('goods7',$data9);
        $this->display();
	}

	public function content(){
		$gid=$_GET['gid'];
        $data10=$this->mod->getgoodsContentbyID();
        $data11 = $this->mod->getgoodstype2();

        $this->assign('goods10',$data10);
        $this->assign('goods11',$data11);
        $this->display();

	}
	public function login()
	 	{
	 		$this->display();
	 	}

	public function dologin()
	 	{
	 		 $data2 = $this->mod->dologins();
          if(isset($_SESSION["user"])){
              echo " 登录成功";
           header("location:index.php");

          }
          else{
             echo " 登录失败";
         header("location:index.php?c=index&m=login");
          }
	 	}
	 public function logout()
	 	{
	 		 session_start();
         session_destroy();
         header("location:index.php");
         $this->display();
	 	}
	 	

}


 ?>